{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "hellohellohello\n"
     ]
    }
   ],
   "source": [
    "print(\"hello\" * 3)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "x = 2, y = 3.000000\n"
     ]
    }
   ],
   "source": [
    "print(\"x = %d, y = %f\" % (2, 3.0))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(2-3j)\n"
     ]
    }
   ],
   "source": [
    "x = 3 + 2j\n",
    "y = -1j\n",
    "print(x * y)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "abcdefg\n",
      "bc\n",
      "bcdefg\n",
      "abc\n",
      "abcdef\n",
      "ef\n",
      "efg\n",
      "abcdefg\n",
      "aceg\n",
      "gfedcba\n"
     ]
    }
   ],
   "source": [
    "strs = \"abcdefg\"\n",
    "print(strs[0:7:1])\n",
    "print(strs[1:3])\n",
    "print(strs[1:])\n",
    "print(strs[:3])\n",
    "print(strs[:-1])\n",
    "print(strs[-3:-1])\n",
    "print(strs[-3:])\n",
    "print(strs[:])\n",
    "print(strs[::2])\n",
    "print(strs[::-1])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "较小值为：  5.4\n"
     ]
    }
   ],
   "source": [
    "def minimal(x, y):\n",
    "    if x > y:\n",
    "        print(\"较小值为： \", y)\n",
    "    else:\n",
    "        print(\"较小值为： \", x)\n",
    "\n",
    "\n",
    "a = float(input(\"请输入第一个数据： \"))  # 输入了 5.4\n",
    "b = float(input(\"请输入第二个数据： \"))  # 输入了 6.8\n",
    "minimal(a, b)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
